package com.jm.hosp.controller;

import com.jm.common.result.Result;
import com.jm.hosp.service.DepartmentService;
import com.jm.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin 网关中已配置跨域
public class DepartmentController {
    @Resource
    private DepartmentService departmentService;

    //根据医院编号，查询医院所有科室
    @ApiOperation("查询医院所有科室")
    @GetMapping("/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return Result.ok(list);
    }
}
